

#ifndef __MOX_COM_C_H__
#define __MOX_COM_C_H__


#ifndef __XC__
mox_msg *mox_comm_msg_recv(schanend c);
void mox_comm_msg_recv_ref(schanend c, mox_msg *msg);
mox_msg *mox_comm_msg_recv_thd(schanend c);
#else
void mox_comm_msg_recv_ref(schanend c, mox_msg &msg);
#endif

void mox_comm_msg_send(schanend c, mox_msg msg);
void mox_comm_msg_send_thd(schanend c, mox_msg msg);
unsigned mox_testct(schanend channel);
unsigned mox_inct(schanend channel);
void mox_outct(schanend channel, unsigned val);

#ifndef __XC__
void mox_comm_connect(schanend control, schanend slave, unsigned slocal);
#endif

unsigned mox_req_com(schanend cslave, unsigned thread);

unsigned mox_end_com(schanend cslave);

#ifndef FLASHER
uchanend mox_create_chan_remote(schanend chan_mox, int first);

void mox_free_chanend(schanend a);

#ifndef __XC__
void mox_create_chan_local(chanend *a, chanend *b);
#endif
#endif


void mox_clear_chans(mox_master_state REF(state));

#endif //__MOX_COM_C_H__
